

// TurtleSquare.java
import gin.and.tonic.*;
import lejos.nxt.Button;
import lejos.nxt.ButtonListener;


public class align295
{

    private DragonRobot robot = new DragonRobot();
    int count=0;

    align295()
    {
        UltrasonicSensor us = new UltrasonicSensor(SensorPort.S1);
        TouchSensor ts = new TouchSensor(SensorPort.S2);
        Motor arm = new Motor(MotorPort.A);
        robot.addPart(us);
        robot.addPart(ts);
        //us.addUltrasonicListener(this,20);
        //  ts.addTouchListener(this);
        arm.setSpeed(20);
        robot.addPart(arm);
        //robot.setTurtleSpeed(80);//051711

        /*Misson module*/
        //robot.setTurtleSpeed(80);
        robot.forward(1180);//052111
        robot.left(16);
        robot.forward(530);//051611//480);
        arm.rotateTo(157);
        robot.right(100);//052411 110);    //finish mission bo gan
        robot.forward(110);//051611//120);
        arm.rotateTo(-39);//051611//-33);
        robot.right(119);   //finish mission bo xiao kuai
       // robot.forward(430);
        //robot.right(30);
        //robot.forward(150);
        //robot.left(60); //finish mission6
       // arm.rotateTo(-129);
       // robot.forward(1400);    //start to push
       // robot.right(90);    //start to cross fields
        robot.exit();
    }

    public static void main(String[] args)
    {
        new align295();
    }
}